//
//  MDAppGlobal.h
//  MideaWorld_Zizhu
//
//  Created by Minus on 4/23/15.
//  Copyright (c) 2015 Minus. All rights reserved.
//

#ifndef MideaWorld_Zizhu_MDAppGlobal_h
#define MideaWorld_Zizhu_MDAppGlobal_h

/////// Utility
#define IS_IOS7    (kCFCoreFoundationVersionNumber > kCFCoreFoundationVersionNumber_iOS_6_1)
#define IS_IOS8    (kCFCoreFoundationVersionNumber > kCFCoreFoundationVersionNumber_iOS_7_1)
#define IS_IPAD    ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
#define IS_IPHONE  ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)
#define Height_StatusBar 20

#define ScreenWidth [[UIScreen mainScreen] bounds].size.width
#define ScreenHeight [[UIScreen mainScreen] bounds].size.height
#define GetViewWidth(view) view.frame.size.width
#define GetViewHeight(view) view.frame.size.height

#define KNavigaionBarHeight (IS_IOS7? 64.f : 0.f)

#ifdef DEBUG
//#define AMLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#define MDLLog(fmt, ...) fprintf(stderr, "%s [Line %d] %s\n", __PRETTY_FUNCTION__, __LINE__, [[NSString stringWithFormat:fmt, ##__VA_ARGS__] UTF8String])
#define MDLog(fmt, ...) fprintf(stderr, "%s [Line %d] %s\n", [NSStringFromClass([self class]) UTF8String], __LINE__, [[NSString stringWithFormat:fmt, ##__VA_ARGS__] UTF8String])
#else
#define MDLLog(fmt, ...)
#define MDLog(...)
#endif

//////Queue
#define Queue_Main dispatch_get_main_queue()
#define Queue_Global_Default dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)


#endif
